<?php

/**
 * sap_mountain form base class.
 *
 * @method sap_mountain getObject() Returns the current form's model object
 *
 * @package    skiaplanche.ca
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class Basesap_mountainForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'createdBy'     => new sfWidgetFormInputText(),
      'modifiedBy'    => new sfWidgetFormInputText(),
      'status'        => new sfWidgetFormInputText(),
      'name'          => new sfWidgetFormInputText(),
      'adress'        => new sfWidgetFormInputText(),
      'city'          => new sfWidgetFormInputText(),
      'zipcode'       => new sfWidgetFormInputText(),
      'longitude'     => new sfWidgetFormInputText(),
      'latitude'      => new sfWidgetFormInputText(),
      'meteoCode'     => new sfWidgetFormInputText(),
      'googleMapCode' => new sfWidgetFormInputText(),
      'provinceId'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('sap_province'), 'add_empty' => false)),
      'created_at'    => new sfWidgetFormDateTime(),
      'updated_at'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'createdBy'     => new sfValidatorInteger(),
      'modifiedBy'    => new sfValidatorInteger(array('required' => false)),
      'status'        => new sfValidatorString(array('max_length' => 20)),
      'name'          => new sfValidatorString(array('max_length' => 75)),
      'adress'        => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'city'          => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'zipcode'       => new sfValidatorString(array('max_length' => 7, 'required' => false)),
      'longitude'     => new sfValidatorPass(array('required' => false)),
      'latitude'      => new sfValidatorPass(array('required' => false)),
      'meteoCode'     => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'googleMapCode' => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'provinceId'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('sap_province'))),
      'created_at'    => new sfValidatorDateTime(),
      'updated_at'    => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('sap_mountain[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'sap_mountain';
  }

}
